<?php
require_once 'top/TopClient.php';
require_once 'top/RequestCheckUtil.php';
require_once 'top/request/TaobaokeItemsGetRequest.php';

$nick = trim($_POST['nick']);
$keyword = trim($_POST['keyword']);
$mallitem = trim($_POST['mallitem']);
if ($nick) {
	$c = new TopClient;
	$c->appkey = '21170405';
	$c->secretKey = 'e7b2c2be477fcd7196e40c1f8b81a0ee';
	$req = new TaobaokeItemsGetRequest;
	$req->setFields("num_iid,title,nick,pic_url,price,click_url,commission,commission_rate,commission_num,commission_volume,shop_click_url,seller_credit_score,item_location,volume");
	if ($mallitem == '1')
		$req->setMallItem("true");
	$req->setNick($nick);        //佣金的淘宝帐号
	$req->setKeyword($keyword);
	$resp = $c->execute($req);
	echo($resp);	
}
exit;